package com.hzlh.service.impl;

import com.hzlh.dao.TCompanyBaseDao;
import com.hzlh.model.TCompanyBase;
import com.hzlh.model.TCompanyBaseVo;
import com.hzlh.service.ICompanyBaseService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CompanyBaseServiceImpl implements ICompanyBaseService {
    @Resource
    TCompanyBaseDao tCompanyBaseDao;

    @Override
    public List<TCompanyBaseVo> selectList(Map<String, Object> param) {
        param = CollectionUtils.isEmpty(param)?new HashMap<>():param;
        return tCompanyBaseDao.selectList(param);
    }

    @Override
    public TCompanyBase selectInfo(String companyName) {
        return tCompanyBaseDao.selectInfo(companyName);
    }

    @Override
    public int updateArea(TCompanyBaseVo tCompanyBaseVo) {
        return tCompanyBaseDao.updateArea(tCompanyBaseVo);
    }

    @Override
    public List<Map<String, Object>> selectAreaCount() {
        return tCompanyBaseDao.selectAreaCount();
    }

    @Override
    public List<Map<String, Object>> selectZoneCount() {
        return tCompanyBaseDao.selectZoneCount();
    }

    @Override
    public List<Map<String, Object>> selectCompanyCount() {
        return tCompanyBaseDao.selectCompanyCount();
    }
}
